#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <netdb.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <arpa/inet.h>
#define BUF_SIZE 256

class TcpClient{
public:
    TcpClient(std::string = "192.168.1.250", int = 4000);
    ~TcpClient();
    bool start();
    void stop();
    int ReadData(std::string &);
    int WriteData(std::string );


    int sockfd;
    std::string addr_;
    struct sockaddr_in server_addr;
    struct hostent *host;
    int port_;
};
